import { ADDRESS_LIST_DATA, SHOW_CHICE_ADDRESS, GET_DEFAULT_ADDRESS} from "./actionsTypes";

export const getDefault = data => ({type: GET_DEFAULT_ADDRESS, data: data});
export const addressList = data => ({type: ADDRESS_LIST_DATA, data: data});//地址列表
export const showChiceAddress = data => ({type: SHOW_CHICE_ADDRESS, data: data});//是否显示默认地址

import commonAction from '../../../../../js/actions/commonAction';

export const getAddAddressList = (data, callBack) => {
    return commonAction.simplePost(data, 'emsc-partner/b/a/gal', addressList, callBack);
};

//设置默认地址
export const setDefaultAddress = (data, callBack) => {
    return commonAction.simplePost(data, 'emsc-partner/b/a/default', undefined, callBack);
};

//获取默认地址
export const getDefaultAddress=(data,callBack)=>{
    return commonAction.simplePost(data,'emsc-partner/b/a/q/default',getDefault,callBack);
};

//删除地址
export const deleteAddress=(data,callBack)=>{
    return commonAction.simplePost(data,'emsc-partner/b/a/dl',undefined,callBack);
};
